package com.example.springdataes.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Data
@Document(indexName = "user_index")
public class User {
    @Id
    private String id;
    @Field(type = FieldType.Keyword)
    private String name;
    @Field(type = FieldType.Integer)
    private int age;
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String addr;
    @Field(type = FieldType.Double)
    private double salary;
}
